home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-rpc.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  69 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                           S Y S T E M . R P C                            --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.6 $                              --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18. with Ada.Streams;
  19. with System.Storage_Elements;
  20.  
  21. package System.RPC is
  22.  
  23.    type Partition_ID is range 0 .. Integer'Last; -- temporary declaration
  24.  
  25.    Communication_Error : exception;
  26.  
  27.    type Params_Stream_Type
  28.      (Initial_Size : Ada.Streams.Stream_Element_Count) is new
  29.        Ada.Streams.Root_Stream_Type with private;
  30.  
  31.    procedure Read
  32.      (Stream : in out Params_Stream_Type;
  33.       Item   : out Ada.Streams.Stream_Element_Array;
  34.       Last   : out Ada.Streams.Stream_Element_Offset);
  35.  
  36.    procedure Write
  37.      (Stream : in out Params_Stream_Type;
  38.       Item   : in Ada.Streams.Stream_Element_Array);
  39.  
  40.    --  Synchronous call
  41.  
  42.    procedure Do_RPC
  43.      (Partition  : in Partition_ID;
  44.       Params     : access Params_Stream_Type;
  45.       Result     : access Params_Stream_Type);
  46.  
  47.    --  Asynchronous call
  48.  
  49.    procedure Do_APC
  50.      (Partition  : in Partition_ID;
  51.       Params     : access Params_Stream_Type);
  52.  
  53.    --  The handler for incoming RPCs.
  54.  
  55.    type RPC_Receiver is
  56.      access procedure
  57.        (Params     : access Params_Stream_Type;
  58.         Result     : access Params_Stream_Type);
  59.  
  60.    procedure Establish_RPC_Receiver (Receiver : in RPC_Receiver);
  61.  
  62. private
  63.  
  64.    type Params_Stream_Type
  65.      (Initial_Size : Ada.Streams.Stream_Element_Count) is new
  66.        Ada.Streams.Root_Stream_Type with null record;
  67.  
  68. end System.RPC;
  69.